package com.parenting.feign.controller;

import com.parenting.feign.entities.ShopAndUserFeignDTO;
import com.parenting.model.User;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.FeignClientProperties;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(value = "system-bend-server", path = "/" ,configuration = FeignClientProperties.FeignClientConfiguration.class)
public interface IFeignSystemUserController {

     @ApiOperation(value = "新增店铺与店长的关系")
     @PostMapping("/api/suer/shop")
     void shopAndUser(@RequestBody @Validated ShopAndUserFeignDTO shopAndUserFeignDTO);

     @ApiOperation(value = "校验该店铺是否被认领")
     @PostMapping("/api/Claim/{shopId}")
     boolean ChekShopClaim(@PathVariable("shopId") String shopId);

     @ApiOperation(value = "校验该店铺是否被认领")
     @PostMapping("/api/Claim/user/{userId}")
     boolean ChekShopClaimUser(@PathVariable("userId") String userId);

     @ApiOperation(value = "根据用户ID获得所在的店铺ID")
     @PostMapping("/api/getShopId/{userId}")
     String getShopIdByLoginUserId(@PathVariable("userId") String userId);


     @ApiOperation(value = "根据用户ID获得所在的店铺ID")
     @PostMapping("/api/getUser/{userName}")
     User getUserByAccount(@PathVariable("userName") String  username);



     @ApiOperation(value = "根据用户ID获得所在的店铺ID")
     @PostMapping("/api/getUserCode/{userId}")
     List<String> findCodeByUserId(@PathVariable("userId") String userId);

}
